<%@include file="_header.jspf" %>
<%@page import="com.spartancoder.accommodation.models.AccommodationSession" %>
<%@page import="com.spartancoder.accommodation.beans.AccommodationSessionBean" %>

<h2>Sesiuni de cazare</h2>

<%
    AccommodationSessionBean ab = AccommodationSession.fetchActive();

    if (ab == null) {
%>
    <form action="start-session.jsp" method="post" class="span-10">
        <fieldset>
            <label class="text large">Nume:</label><br />
            <input type="text" class="text large" name="name" value="Cazare 2009" />
           <button type="submit" class="button positive">
               Permite cazare studentilor
           </button>
        </fieldset>
    </form>
<%  } else { %>
    Sesiune: <b><%=ab.getName()%></b> activa de la data de <%=ab.getStartDate()%><br />
    <a href="stop-session.jsp">Inchide sesiunea.</a>
<%  } %>

<%@include file="_footer.jspf" %>